<script type="text/javascript" src="/Public/js/admin_node.js"></script>
<div class="pageContent" layoutH="58">
  <form action="" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, 'navTabAjaxDone');">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a class="add" rel="key[]"  callback="callback_handle" target="selectedTodo" title="确实要删除节点吗?" href="<?PHP echo __URL__.'/post_clear_node';?>"><span>删除节点</span></a></li>
        </ul>
    </div>  
	<?php 
		if($list){	
	?>	
		<table class="list" width="100%">
			<thead>
			<tr>
			  <th width="77"><input type="checkbox" id="myCheckBox" onclick="checkAll(this)" />ID</th>
				<th width="245">插件</th>
				<th width="253">模块</th>
				<th width="253">操作</th>
				<th width="257">标题</th>
			</tr>
			</thead>
			<tbody>
			<?php foreach ($list as $k=>$v): ?>
				<tr id="box<?php echo $k;?>">
					<td><input type="checkbox" name="key[]" id="checkbox<?php echo $k;?>" value="<?php echo $k;?>" /><?php echo $k;?></td>
					<td><?php echo empty($v['modules']) ? 'NULL' : $v['modules']; ?></td>
					<td><?php echo empty($v['controller']) ? 'NULL' : $v['controller']; ?></td>
					<td><?php echo empty($v['method']) ? 'NULL' : $v['method']; ?></td>
					<td><?php echo empty($v['title']) ? 'NULL' : $v['title']; ?></td>
				</tr>
			<?php endforeach; ?>       
			</tbody>
		</table>
	<?php 
		}else{
			echo '<h3 style="color:red; text-align:center;line-height:30px">暂无新权限！</h3>';
		}	
	?>				
  </form> 
</div>
<script language="javascript">
/**
*** 导入权限后的回调操作
*** （加载外部JS会导致Chrome、Firefox不兼容）
**/
function callback_handle(json)
{
	if (json.statusCode == DWZ.statusCode.ok)
	{
		var stringObj=json.message;   
		var newstr=stringObj.replace("<p>操作成功!</p>","");
		arr = newstr.split('_'); 
		for(var i=0;i<arr.length;i++){			
			$("#box"+arr[i]).remove();
		}		
	} 
}
</script>